/*
Copyright (C) 2010 Gerhard Olsson

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Drawing;
using System.Collections.Generic;
using ZoneFiveSoftware.Common.Data;
using ZoneFiveSoftware.Common.Data.Fitness;
using ZoneFiveSoftware.Common.Data.GPS;
using ZoneFiveSoftware.Common.Visuals;

namespace MatrixPlugin
{
    public enum DataSource
    {
        AllActivities,
        ActivitiesThisYear,
        ActivitiesThisDay,
        CurrentActivity,
        CurrentSelection,
        UniqueRoutes
    }
    class DataSourceLabelProvider : TreeList.ILabelProvider
    {
        public static IList<DataSource> getValues(bool UR)
        {
            IList<DataSource> results = null;
            if (UR)
            {
                results = (IList<DataSource>)Enum.GetValues(typeof(DataSource));
            }
            else
            {
               results = new List<DataSource> { DataSource.AllActivities, DataSource.ActivitiesThisYear, DataSource.ActivitiesThisDay, DataSource.CurrentActivity, DataSource.CurrentSelection };
            }
            return results;
        }

        public Image GetImage(object element, TreeList.Column column)
        {
            return null;
        }
        public string GetText(object element, TreeList.Column column)
        {
            return GetText((DataSource)element);
        }
        public static string GetText(DataSource t)
        {
            switch (t)
            {
                case DataSource.AllActivities:
                    return Properties.Resources.dataSource_AllActivites;
                case DataSource.ActivitiesThisYear:
                    return Properties.Resources.dataSource_ActivitiesThisYear;
                case DataSource.ActivitiesThisDay:
                    return Properties.Resources.dataSource_ActivitiesThisDay;
                case DataSource.CurrentActivity:
                    return Properties.Resources.dataSource_CurrentActivity;
                case DataSource.UniqueRoutes:
                    return Properties.Resources.dataSource_UniqueRoutes;
                default:
                case DataSource.CurrentSelection:
                    return Properties.Resources.dataSource_CurrentSelection;
            }
        }
    }
}